#include <iostream>
#include <bitset>

using namespace std;

template <size_t N>
class Exam
{
public:
    Exam() : bs() {}
    size_t getSize() { return N; }
    void setSolution(size_t n, bool b) { bs.set(n, b); }
    size_t score(const bitset<N> &rhs);
    bitset<N> &getSolutions() { return bs; }

private:
    bitset<N> bs;
};

template <size_t N>
size_t Exam<N>::score(const bitset<N> &rhs)
{
    bitset<N> tmp = bs ^ rhs;
    return N - tmp.count();
}

int main()
{
    Exam<10> e;
    e.setSolution(2, true);
    e.setSolution(4, true);
    e.setSolution(7, true);
    cout << e.getSolutions() << endl;
    bitset<10> classmate;
    classmate.set(1, true);
    cout << classmate << endl;
    cout << "Your score is: " << e.score(classmate) << endl;
}
